<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>对象作业</title>
    <style>
        pre {
            font-size: 20px;
        }
    </style>
</head>

<body>
    <script>
        //T1.输出arr中年龄小于17的对象
        var arr = [{
            name: "111",
            sex: "boy",
            age: 18,
        }, {
            name: "222",
            sex: "girl",
            age: 17,
        }, {
            name: "333",
            sex: "boy",
            age: 16,
        }, {
            name: "444",
            sex: "girl",
            age: 15,
        }, {
            name: "555",
            sex: "boy",
            age: 20,
        }, ];
        // T2思考题非必做 123['toString'].length + 123 =？为什么
    </script>

    <h1>1.</h1>
    <pre>
      var arr = [{
        name: "111",
        sex: "boy",
        age: 18,
    }, {
        name: "222",
        sex: "girl",
        age: 17,
    }, {
        name: "333",
        sex: "boy",
       
    }, {
        name: "444",
        sex: "girl",
        age: 15,
    }, {
        name: "555",
        sex: "boy",
        age: 20,
    }, ];

    var newarr = arr.filter(function(ele, index) {
        return ele.age < 17;
    });
    console.log(newarr);
    </pre>

    <h1>2.</h1>
    <pre>
         124 
         length 是函数对象的一个属性值，指该函数有多少个参数，即形参的个数。
         形参的数量不包括剩余参数个数以及含第一个具有默认值之后的参数个数</pre>
</body>

</html>